//
//  RootModel.m
//  UI12_Model
//
//  Created by ChuXiang on 15/11/11.
//  Copyright © 2015年 ChuXiang. All rights reserved.
//

#import "RootModel.h"

@implementation RootModel
- (instancetype)initWithData:(NSDictionary *)data {
    self = [super init];
    if (self) {
        [self setValuesForKeysWithDictionary:data];
    }
    return self;
}

- (id)valueForUndefinedKey:(NSString *)key {
    return nil;
}
- (void)setValue:(id)value forUndefinedKey:(NSString *)key {
    if ([key isEqual:@"data"]) {
        NSArray *array = value;
        NSMutableArray *array1 = [[NSMutableArray alloc] initWithCapacity:0];
        for (NSDictionary *dic in array) {
            ShowModel *showModel = [[ShowModel alloc] initWithData:dic];
            [array1 addObject:showModel];
        }
        self.dataSource = [[NSArray alloc] initWithArray:array1];
    }
}
@end
